
ADD_DEFINITIONS(-DBMQT_LIBRARY)


SET(LIB_NAME bmQT)

SET(HEADER_PATH ${BLUEMOON_SOURCE_DIR}/include/${LIB_NAME})
SET(SOURCE_PATH ${BLUEMOON_SOURCE_DIR}/src/${LIB_NAME})


# example for qt
SET(QT_MOC_SOURCES_H
  ${HEADER_PATH}/QGraphicsViewAdapter.h
)

IF(Qt5Widgets_FOUND)
    #    SET(CMAKE_AUTOMOC ON)
    QT5_WRAP_CPP(SOURCES_CXX_MOC ${QT_MOC_SOURCES_H} OPTIONS "-fbmQT/QGraphicsViewAdapter.h")
ELSE()
    QT4_WRAP_CPP( SOURCES_CXX_MOC ${QT_MOC_SOURCES_H} OPTIONS "-f" )
ENDIF()

SOURCE_GROUP(${QTMocFileGroupName} FILES ${SOURCES_CXX_MOC})

SET(LIB_PUBLIC_HEADERS
  ${QT_MOC_SOURCES_H}
  ${HEADER_PATH}/export.h
  ${HEADER_PATH}/GraphicsWindowQt.h
  ${HEADER_PATH}/QFontImplementation.h
  ${HEADER_PATH}/QWebViewImage.h
  ${HEADER_PATH}/QWidgetImage.h
)

SET( LIB_SOURCES
  ${SOURCES_CXX_MOC}
  ${SOURCE_PATH}/CMakeLists.txt
  ${SOURCE_PATH}/GraphicsWindowQt.cpp
  ${SOURCE_PATH}/QFontImplementation.cpp
  ${SOURCE_PATH}/QGraphicsViewAdapter.cpp
  ${SOURCE_PATH}/QWidgetImage.cpp
)

#SET(LIB_INTERNALS
#  DataDB
#  Net
#  )

SET(LIB_DEPS
  #TINYXML_LIBRARY
  OPENTHREADS_LIBRARY
  OSGTEXT_LIBRARY
  )

IF(QT4_FOUND)
  INCLUDE_DIRECTORIES(
    ${QT_INCLUDE_DIR}
    ${QT_QTCORE_INCLUDE_DIR}
    ${QT_QTGUI_INCLUDE_DIR}
    ${QT_QTOPENGL_INCLUDE_DIR}
    )
  SET(LIB_DEPS
    ${LIB_DEPS}
    QT_QTCORE_LIBRARY
    QT_QTGUI_LIBRARY
    QT_QTOPENGL_LIBRARY
    )
ENDIF(QT4_FOUND)

BLUEMOON_ADD_LIBRARY(${LIB_NAME})

IF(Qt5Widgets_FOUND)
    qt5_use_modules(${LIB_NAME} Widgets OpenGL)
ENDIF(Qt5Widgets_FOUND)
